import request from "@/utils/request.js";

/**
 * 机构分页
 * @param params
 * @returns {AxiosPromise}
 */
export function listPageOrg(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/listPageOrg",
    method: "post",
    data: params
  });
}

/**
 * 机构分页
 * @param params
 * @returns {AxiosPromise}
 */
export function addOrg(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/addOrg",
    method: "post",
    data: params
  });
}

/**
 * 获取机构详情
 * @param params
 * @returns {AxiosPromise}
 */
export function getOrgInfoById(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/getOrgInfoById",
    method: "post",
    data: params
  });
}

/**
 * 修改机构详情
 * @param params
 * @returns {AxiosPromise}
 */
export function modifyOrgInfoById(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/modifyOrgInfoById",
    method: "post",
    data: params
  });
}

/**
 * 修改机构主要信息
 * @param params
 * @returns {AxiosPromise}
 */
export function modifyOrgDoMainInfoById(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/modifyOrgDoMainInfoById",
    method: "post",
    data: params
  });
}

/**
 * 运营启用禁用机构
 * @param params
 * @returns {AxiosPromise}
 */
export function modifyOrgStatus(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/modifyOrgStatus",
    method: "post",
    data: params
  });
}

/**
 * 机构配置
 * @param params
 * @returns {AxiosPromise}
 */
export function listOrgCourseOnOperatePlatform(params) {
  return request({
    url:
      "/teachingPlatformService/api/orgCourse/listOrgCourseOnOperatePlatform",
    method: "post",
    data: params
  });
}

/**
 * 机构启用课程
 * @param params
 * @returns {AxiosPromise}
 */
export function updateOrgCourseUseFlag(params) {
  return request({
    url: "/teachingPlatformService/api/orgCourse/updateOrgCourseUseFlag",
    method: "post",
    data: params
  });
}

/**
 * 运营后台-机构配置-发放学习卡
 * @param params
 * @returns {AxiosPromise}
 */
export function mangerCreateCardOrder(params) {
  return request({
    url: "/teachingPlatformService/api/cardOrder/mangerCreateCardOrder",
    method: "post",
    data: params
  });
}

/**
 * 机构后台-机构配置-个人分配学习卡明细
 * @param params
 * @returns {AxiosPromise}
 */
export function cardList(params) {
  return request({
    url: "/teachingPlatformService/api/card/cardList",
    method: "post",
    data: params
  });
}

/**
 * 教学管理平台-机构配置-机构分配明细
 * @param params
 * @returns {AxiosPromise}
 */
export function getReceiveOrgCard(params) {
  return request({
    url: "/teachingPlatformService/api/card/getReceiveOrgCard",
    method: "post",
    data: params
  });
}

//↓↓↓机构试卷配置 ↓↓↓

/**
 * 机构试卷分页列表
 * @param params
 * @returns {AxiosPromise}
 */
export function listPageOrgTestPaper(params) {
  return request({
    url: "/teachingPlatformService/api/orgTestPaper/listPageOrgTestPaper",
    method: "post",
    data: params
  });
}
/**
 *机构添加试卷
 * @param params
 * @returns {AxiosPromise}
 */
export function addOrgTestPaper(params) {
  return request({
    url: "/teachingPlatformService/api/orgTestPaper/addOrgTestPaper",
    method: "post",
    data: params
  });
}

/**
 * 修改机构试卷状态
 * @param params
 * @returns {AxiosPromise}
 */
export function updateStartUsing(params) {
  return request({
    url: "/teachingPlatformService/api/orgTestPaper/updateStartUsing",
    method: "post",
    data: params
  });
}

/**
 * 二级机构模糊搜索
 * @param params
 * @returns {AxiosPromise}
 */
export function stairOrgList(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrg/stairOrgList",
    method: "post",
    data: params
  });
}

/**
 * 考试选取试卷
 * @param params
 * @returns {AxiosPromise}
 */
export function listTestPagerNames(params) {
  return request({
    closeLoading: true,
    url: "/studyService/api/orgTestPaper/listTestPagerNames",
    method: "post",
    data: params
  });
}
